/**
 * 2013-6-26 下午10:45:06 Created By niexiaoqiang
 */

package com.xiaoqiang.MtwV2ForMoblie.update;

import java.io.File;

import android.content.Intent;
import android.net.Uri;

import com.xiaoqiang.MtwV2ForMoblie.MainActivity;

/**
 * TODO Add Class Description
 */
public class InstallApk {

	private MainActivity mainActivity;

	public InstallApk(MainActivity mainActivity) {
		this.mainActivity = mainActivity;
	}

	public void openFile(File file) {
		Intent intent = new Intent();
		intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		intent.setAction(android.content.Intent.ACTION_VIEW);
		intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
		mainActivity.startActivity(intent);
	}
}
